package org.example.medical.Mapper;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.example.medical.entity.Patient;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface PatientMapper {

    List<Patient> selectByPage(
            @Param("name") String name,
            @Param("gender") String gender,
            @Param("offset") int offset,
            @Param("size") int size
    );

    // 查询总数
    Long countByCondition(
            @Param("name") String name,
            @Param("gender") String gender
    );

    // 动态更新
    int updatePatientSelective(Patient patient);

    // 软删除
    int softDelete(@Param("patientId") Integer patientId);

    void insertPatient(Patient patient);

    void batchDeletePatients(@Param("patientIds") List<Integer> patientIds);
}